package com.finance.rule.dao;

import com.finance.framework.lang.Page;
import com.finance.rule.bean.pojo.WeightRangeRule;
import com.finance.system.bean.pojo.Region;
import com.finance.system.bean.pojo.Supplier;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by CBWL on 2017/3/17.
 */
@Component
public interface WeightRangeMapper {
    List<WeightRangeRule> listByPage(Page page);

    WeightRangeRule getById(Long id);

    int countByCode(String code);

    /**
     *查找除Id以外的数据 存在code的数量
     * 以此为跟新数据的前提条件
     * */
    int countByCodeAndId(@Param("code") String code, @Param("id")Long id);

    int add(WeightRangeRule weightRange);

    int update(@Param("weightRangeRule") WeightRangeRule weightRangeRule);

    int del(@Param("uid")String uid,@Param("ids")List<String>ids);

    List<WeightRangeRule> getWeightRangeRuleBySupplier(Supplier supplier);

    List<WeightRangeRule> getWeightRangeRuleByDirection(int directionEnum);

    List<WeightRangeRule> getWeightRangeRuleBySendRegion(Region region);

    List<WeightRangeRule> getWeightRangeRuleBySignRegion(Region region);
}
